package com.baomibing.flow.constant;

import com.baomibing.flow.enginee.Process;
import com.baomibing.flow.enginee.*;

public enum ProcessTypeEnum {

    SUB,FORK,JOIN,PARALLEL,TASK_JOIN;

    public Class<? extends Process> getTypeOfClass() {

        if (this == SUB) {
            return SubProcess.class;
        } else if (this == FORK) {
            return ForkProcess.class;
        } else if (this == JOIN) {
            return JoinProcess.class;
        } else if (this == PARALLEL) {
            return ParallelProcess.class;
        } else if (this == TASK_JOIN) {
            return TaskJoinProcess.class;
        }

        throw new RuntimeException("invalid process type");
    }
}
